package com.sunwayworld.basemodule.business.batchrevise.dao.impl;

import com.sunwayworld.basemodule.business.batchrevise.bean.LimsSampleTempBean;
import com.sunwayworld.basemodule.business.batchrevise.dao.LimsSampleTempDao;
import com.sunwayworld.basemodule.business.batchrevise.mapper.LimsSampleTempMapper;
import com.sunwayworld.framework.mybatis.dao.MybatisDaoSupport;
import com.sunwayworld.framework.mybatis.mapper.MapperParameter;
import com.sunwayworld.framework.spring.annotation.GikamBean;
import com.sunwayworld.framework.utils.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
@GikamBean
public class LimsSampleTempDaoImpl extends MybatisDaoSupport<LimsSampleTempBean, Long> implements LimsSampleTempDao {

    @Autowired
    private LimsSampleTempMapper limsSampleMapper;

    @Override
    public LimsSampleTempMapper getMapper() {
        return limsSampleMapper;
    }

    @Override
    public Map<String, Object> selectDetail(Long id) {
        MapperParameter parameter = new MapperParameter();
        parameter.put("id",id);
        List<Map<String, Object>> mapList = getMapper().selectDetail(parameter);
        return mapList.isEmpty() ? CollectionUtils.emptyMap() : mapList.get(0);
    }
}
